home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
math
/
nrpas13
/
caldat.dem
< prev
next >
Wrap
Text File
|
1991-04-29
|
1KB
|
43 lines
PROGRAM d1r4(input,output,dfile);
(* driver for routine CALDAT *)
TYPE
month = PACKED ARRAY [1..10] OF char;
VAR
i,id,idd,im,imm,iy,iyy,j,n : integer;
name : ARRAY [1..12] OF month;
dfile : text;
(*$I MODFILE.PAS *)
(*$I JULDAY.PAS *)
(*$I CALDAT.PAS *)
BEGIN
(* check whether caldat properly undoes the operation of julday *)
name[1] := 'january ';
name[2] := 'february ';
name[3] := 'march ';
name[4] := 'april ';
name[5] := 'may ';
name[6] := 'june ';
name[7] := 'july ';
name[8] := 'august ';
name[9] := 'september ';
name[10] := 'october ';
name[11] := 'november ';
name[12] := 'december ';
glopen(dfile,'dates1.dat');
readln(dfile);
readln(dfile,n);
writeln;
writeln('original date:','reconstructed date:':43);
writeln('month':5,'day':8,'year':6,'julian day':15,
'month':9,'day':8,'year':6);
FOR i := 1 to n DO BEGIN
readln(dfile,im,id,iy);
j := julday(im,id,iy);
caldat(j,imm,idd,iyy);
writeln(name[im],id:3,iy:6,j:13,name[imm]:16,idd:3,iyy:6)
END
END.